import {  Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'
import { VideoService } from './video.service'
import { CreateVideoDto } from './dto/create-video.dto'
import { UpdateVideoDto } from './dto/update-video.dto'

@Controller('video')
export class VideoController {
  constructor(private readonly videoService: VideoService) {}


  /**
   * 上传文章
   * @param createVideoDto
   */
  @Post()
  create(@Body() createVideoDto: CreateVideoDto) {
    return this.videoService.create(createVideoDto)
  }











  @Get()
  findAll() {
    return this.videoService.findAll()
  }

  @Get(':id')
  findOne(@Param('id') id: string) {

    console.log('++++++++++++++'+id)
   
    return this.videoService.findOne(+id)
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateVideoDto: UpdateVideoDto) {
    return this.videoService.update(+id, updateVideoDto)
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.videoService.remove(+id)
  }
}
